package com.wangcp.springboottenant.controller;

import com.wangcp.springboottenant.entity.Student;
import com.wangcp.springboottenant.entity.Users;
import com.wangcp.springboottenant.mapper.StudentMapper;
import com.wangcp.springboottenant.mapper.UserMapper;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/test/")
public class TestController {

    @Autowired
    private UserMapper userMapper;
    @Autowired
    private StudentMapper studentMapper;

    @GetMapping("/queryUsers")
    public List<Users> queryUsers(){
        List<Users> users = userMapper.selectList(null);
        return users;
    }

    @GetMapping("/queryStudents" )
    public List<Student> queryStudents(){
        List<Student> students = studentMapper.selectList(null);
        return students;
    }
}
